package com.project.controller;

import com.project.entity.po.Duty;
import com.project.result.ResponseResult;
import com.project.service.DutyService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/duty")
public class DutyController {
    @Resource
    DutyService dutyService;

    /**
     * 查询所有员工值班信息
     * @return
     */
    @GetMapping("/select/all/duty")
    public ResponseResult<List<Duty>> selectAllDuty(){
        return dutyService.selectAllDuty();
    }

    /**
     * 根据员工名字进行模糊查询
     * @return
     */
    @GetMapping("/select/duty/name")
    public ResponseResult<List<Duty>> selectDutyByName(String name){
        return dutyService.selectDutyByName(name);
    }
}
